package com.ruoyi.consume.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.consume.mapper.GreenhousefilmConsumeMapper;
import com.ruoyi.consume.domain.GreenhousefilmConsume;
import com.ruoyi.consume.service.IGreenhousefilmConsumeService;

/**
 * 查看领用信息Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-23
 */
@Service
public class GreenhousefilmConsumeServiceImpl implements IGreenhousefilmConsumeService
{
    @Autowired
    private GreenhousefilmConsumeMapper greenhousefilmConsumeMapper;

    /**
     * 查询查看领用信息
     *
     * @param greenhousefilmConsumeId 查看领用信息ID
     * @return 查看领用信息
     */
    @Override
    public GreenhousefilmConsume selectGreenhousefilmConsumeById(Long greenhousefilmConsumeId)
    {
        return greenhousefilmConsumeMapper.selectGreenhousefilmConsumeById(greenhousefilmConsumeId);
    }

    /**
     * 查询查看领用信息列表
     *
     * @param greenhousefilmConsume 查看领用信息
     * @return 查看领用信息
     */
    @Override
    public List<GreenhousefilmConsume> selectGreenhousefilmConsumeList(GreenhousefilmConsume greenhousefilmConsume)
    {
        return greenhousefilmConsumeMapper.selectGreenhousefilmConsumeList(greenhousefilmConsume);
    }

    /**
     * 新增查看领用信息
     *
     * @param greenhousefilmConsume 查看领用信息
     * @return 结果
     */
    @Override
    public int insertGreenhousefilmConsume(GreenhousefilmConsume greenhousefilmConsume)
    {
        greenhousefilmConsume.setCreateTime(DateUtils.getNowDate());
        return greenhousefilmConsumeMapper.insertGreenhousefilmConsume(greenhousefilmConsume);
    }

    /**
     * 修改查看领用信息
     *
     * @param greenhousefilmConsume 查看领用信息
     * @return 结果
     */
    @Override
    public int updateGreenhousefilmConsume(GreenhousefilmConsume greenhousefilmConsume)
    {
        greenhousefilmConsume.setUpdateTime(DateUtils.getNowDate());
        return greenhousefilmConsumeMapper.updateGreenhousefilmConsume(greenhousefilmConsume);
    }

    /**
     * 批量删除查看领用信息
     *
     * @param greenhousefilmConsumeIds 需要删除的查看领用信息ID
     * @return 结果
     */
    @Override
    public int deleteGreenhousefilmConsumeByIds(Long[] greenhousefilmConsumeIds)
    {
        return greenhousefilmConsumeMapper.deleteGreenhousefilmConsumeByIds(greenhousefilmConsumeIds);
    }

    /**
     * 删除查看领用信息信息
     *
     * @param greenhousefilmConsumeId 查看领用信息ID
     * @return 结果
     */
    @Override
    public int deleteGreenhousefilmConsumeById(Long greenhousefilmConsumeId)
    {
        return greenhousefilmConsumeMapper.deleteGreenhousefilmConsumeById(greenhousefilmConsumeId);
    }

    /**
     * 获取用户下拉框
     *
     * @param
     * @return 结果
     */
    @Override
    public List<GreenhousefilmConsume> getUserName(){
        return greenhousefilmConsumeMapper.getUserName();
    }
}
